project(SnakeBox)

find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets)

set(SnakeBox_inc
"inc/application.h" 
"inc/system/window_system.h"
"inc/system/preview_system.h"
"inc/gfx/dx12/dx_common.h"
"inc/gfx/dx12/descriptor_heap.h"
"inc/gfx/dx12/command.h"
"inc/gfx/dx12/swapchain.h"
"inc/gfx/dx12/helper.h"
"inc/gui/GuiBase.h"
"inc/gui/Dx12GlfwGui.h"
"inc/res/static_resource.h"
"inc/gfx/dx12/frame_buffer.h"
"inc/gfx/dx12/texture.h"
"inc/res/icon_font_def.h"
"inc/res/icon_font_def_u8.h"
"inc/gfx/dx12/core.h"
"inc/gfx/dx12/queue.h"
"src/command.cpp"
"inc/gfx/dx12/render_target.h"
"inc/system/config_system.h"
"inc/system/scene_system.h"
"inc/physical/3d/foundation.h"
"inc/gfx/dx12/constant_buffer.h"
"inc/system/input_mapping.h"
"inc/system/render_system.h"
"inc/physical/3d/layer_interface.h"
"inc/physical/3d/temp_allocator.h"
"inc/system/script_system.h"
"inc/component/transform.h")

set(SnakeBox_src
"./main.cpp"
"src/window_system.cpp" 
"src/descriptor_heap.cpp" 
"src/swapchain.cpp"
"src/GuiBase.cpp"
"src/Dx12GlfwGui.cpp"
"rc/windows/source/static_resourcec.cpp"
"src/GuiTheme.cpp"
"src/texture.cpp"
"src/GuiControl.cpp"
"src/core.cpp"
"src/queue.cpp"
"src/render_target.cpp"
"src/preview_system.cpp"
"src/config_binding.cpp"
"src/scene_system.cpp"
"src/foundation.cpp"
"src/application.cpp"
"src/render_system.cpp" "src/pipeline/pipeline.cpp" "src/physical/temp_allocator.cpp")

set(proto_models
"./protos/build/setting.pb.h"
"./protos/build/setting.pb.cc"
)

set(SnakeBox_ui
"./inc/window/setting/SettingWindow.h"
"./inc/window/setting/SettingWindow.cpp"
"./inc/window/setting/SettingWindow.ui"
)

set(SnakeBox_rc "./rc/windows/application.rc")

#if(WIN32)
#    set(SnakeBox_rc )
#endif(WIN32)

add_executable(${PROJECT_NAME} ${SnakeBox_inc} ${SnakeBox_src} ${proto_models} ${SnakeBox_rc})
#${SnakeBox_ui}
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/inc" "${CMAKE_CURRENT_LIST_DIR}/protos/build")
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets ws2_32 utility spdlog ImGui_GLFW_DX12 glfw d3d12 dxgi protobuf::libprotobuf Jolt)
#Qt6::Widgets

set(shader_build_path "${CMAKE_CURRENT_LIST_DIR}/src/pipeline")

add_subdirectory("./shaders")

message(${PROJECT_BINARY_DIR}=====================)

set(imgui_config_path "${PROJECT_BINARY_DIR}/imgui.ini")

IF(EXISTS ${imgui_config_path})
	file(COPY ${imgui_config_path} DESTINATION "${CMAKE_CURRENT_LIST_DIR}/rc/windows/imgui_config")
ENDIF()

#set_target_properties(${PROJECT_NAME} PROPERTIES
#    AUTOMOC ON
#    AUTOUIC ON
#)